package com.hubu.map;
import java.util.Objects;
public class JavaHashMapTest {
    public static void main(String[] args) {
        JavaHashMap<Foo,String> map=new JavaHashMap<>();
        int begin=1;
        for(int i=0;i<100;i++){
            Foo foo=new Foo(begin+i*16);
            map.put(foo,"hello"+i);
        }
    }
    static class Foo{
        int id;

        public Foo(int id){
            this.id=id;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Foo foo = (Foo) o;
            return id == foo.id;
        }

        @Override
        public int hashCode() {
            return Objects.hash(id);
        }
    }
}
